<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/12
 * Time: 13:54
 */

namespace common\modules\source;


use Yii;

class Module extends \yii\base\Module
{
    /**
     * @var array Nav bar items.
     */
    public $navbar;
    /**
     * @var string Main layout using for module. Default to layout of parent module.
     * Its used when `layout` set to 'left-menu', 'right-menu' or 'top-menu'.
     */
    public $mainLayout = '@app/views/layouts/main.php';
//    public $mainLayout = '@mdm/admin/views/layouts/main.php';
    /**
     * @var array
     * @see [[menus]]
     */
    private $_menus = [];
    /**
     * @var array
     * @see [[menus]]
     */
    private $_coreItems = [
        'user' => 'Users',
        'assignment' => 'Assignments',
        'role' => 'Roles',
        'permission' => 'Permissions',
        'route' => 'Routes',
        'rule' => 'Rules',
        'menu' => 'Menus',
    ];

    public $controllerNamespace = 'mdm\admin\controllers';
    /**
     * @var array
     * @see [[items]]
     */
    private $_normalizeMenus;

    /**
     * @var string Default url for breadcrumb
     */
    public $defaultUrl;

    /**
     * @var string Default url label for breadcrumb
     */
    public $defaultUrlLabel;

    /**
     * @inheritdoc
     */
    public function init()
    {
        parent::init();
//        $this->setLayoutPath(__DIR__ . '/views/layouts');
//        var_dump($this->getLayoutPath());
//        $this->setViewPath(__DIR__ . '/views');
    }

    /**
     * @inheritdoc
     */
    public function beforeAction($action)
    {
        $get = Yii::$app->request->get();

    }
}